package loengud.w11.simpsons;

public class Marge implements Runnable {

	CookieJar jar;

	public Marge(CookieJar jar) {
		this.jar = jar;
	}

	public void bake(int cookieNumber) {
		jar.putCookie("Marge", cookieNumber);

		try {
			Thread.sleep((int) Math.random() * 500);
		} catch (InterruptedException ie) {
		}
	}

	public void run() {
		for (int i = 0; i < 10; i++)
			bake(i);
	}
}
